POV-Ray : Newsgroups : povray.binaries.images : The De Groot Islands : Re: The De Groot Islands: Foaming seas Server Time
9 Aug 2024 19:37:39 EDT (-0400)
  Re: The De Groot Islands: Foaming seas  
From: Marc Jacquier
Date: 1 Feb 2005 04:56:15
Message: <41ff523f@news.povray.org>

news:41ff38f8@news.povray.org...
> This image brings me to a question to the community at large:
>
> Marc Jacquier (and others, I believe) have worked on the production of
foam
> in the shallow parts of seas. That was based on image-based height_field
> functions, if I remember correctly, and it worked very well. I tried to
use
> the procedure with isosurfaces, but the only thing I got was foam over the
> whole sea surface, not only in the shallows. What did I do wrong? Or how
> should the expected results be obtained? Any suggestion is most welcome!!
> Thanks indeed!
>
> Thomas
>
>
Hi Thomas,
I'm not quite sure but I believe conversion from image to function with
.gray takes rgb but  filter and transmit as well.
And transmit is at 1 out of the image  zone to make it transparent.
What I do is crappy : invert the image in an image editor  then  multiply
the function by a negative factor in the texturing process.
But here you don't use bitmaps, do you?
You are using  functions. So the function factor in the texturing process
should be positive.

For my POVComp entry, I had only to evaluate distance from a central point
(I won't spoil more ;-)
I took the lazy path using cylindrical pattern but you can change for any
function.

Here is  my sea material code ( media set for 1 pov unit= 1 meter)

#declare T_eau=texture // free (without foam) sea texture
      {
         pigment
         {
            color rgbt 1
         }


     finish
         {
            ambient 0

            specular 1
            roughness 0.0001
            conserve_energy
            reflection
            {
               0.0 ,3
               fresnel  on
             falloff 1
              exponent 1
               metallic 0.0
            }
         }

      }

#declare T_mousse=texture  // foam texture
        {pigment{
                color rgb 1 transmit .3
                }
         finish{ambient 0
                diffuse 1
                }
normal{bumps 0.1 scale 0.2}
        }

#declare P_img=
   pigment
   {
     cylindrical
      color_map
      {
         [0.0     rgb 1 ]
         [1  rgb 0 ]

      }

warp   { turbulence .02 lambda 7 }
      scale 200
    // rotate 90.0 * x // decomment for Moray coordinate system
 poly_wave 0.5
   }


#declare F_img=function{pigment {P_img}}
#declare f_crackle_moi = function {pattern {crackle  warp {turbulence 0.65
lambda 3} scale <1,1,2>*2}} //turb 0.7
#declare F_var_crackle=function{min(1, f_crackle_moi(x, y,
z)*max(0,(F_img(x, y, z).gray)*40))}


#declare M_Iso_Sea =
   material
   {  texture{
    function{F_var_crackle(x,y,z)}
    texture_map{

     [.35 T_mousse] //.4
     [.85 T_eau] //.5

    }
   }

      interior
      {
         ior 1.333
         caustics 2.0
         media
         {
            samples 1,1
            absorption rgb <1.0, 0.1, 0.18>*2
            scattering
            {
               3 ,  rgb <1,1,0.9>*.15
               extinction 1
            }
         }
      }
   }


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.